package com.example.administrator.readbook.widget;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * Created by ShaoGeng on 2018/5/15.
 * email 1002919029@qq.com
 * GitHub https://github.com/shaogeng1994
 */

public class NoScrollViewPager extends ViewPager {
    private boolean noScroll = false;

    public NoScrollViewPager(Context var1, AttributeSet var2) {
        super(var1, var2);
    }

    public NoScrollViewPager(Context var1) {
        super(var1);
    }

    public void setNoScroll(boolean var1) {
        this.noScroll = var1;
    }

    public void scrollTo(int var1, int var2) {
        super.scrollTo(var1, var2);
    }

    public boolean onTouchEvent(MotionEvent var1) {
        return this.noScroll?false:super.onTouchEvent(var1);
    }

    public boolean onInterceptTouchEvent(MotionEvent var1) {
        return this.noScroll?false:super.onInterceptTouchEvent(var1);
    }

    public void setCurrentItem(int var1, boolean var2) {
        super.setCurrentItem(var1, var2);
    }

    public void setCurrentItem(int var1) {
        super.setCurrentItem(var1);
    }
}
